home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / ttempna4.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  931 b   |  34 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TTempName
  4. //    Include File:    ttempnam.h
  5. //    Purpose:    Provide a standard way of naming temporary files.
  6. //    Remarks/Portability/Dependencies/Restrictions:
  7. //    Revision History:
  8. //        02-15-94    created
  9. #include"ttempnam.h"
  10. #include"tcapture.h"
  11. #include<stdio.h>
  12. #include<errno.h>
  13.  
  14. void TTempName::unlink() const    {
  15. //    Purpose:    Deletes the file associated with the temporary
  16. //            file name.
  17. //    Arguments:    void
  18. //    Return Value:    void
  19. //    Remarks/Portability/Dependencies/Restrictions:
  20. //    Revision History:
  21. //        02-15-94    created
  22.  
  23.     //    Do we have a file name?
  24.     if(cp_TempName == NULL)    {
  25.         doslynxmessage("No temporary file name to delete.");
  26.         return;
  27.     }
  28.  
  29.     //    Delete the file and check for error codes.
  30.     if(::unlink(cp_TempName) == -1)    {
  31.         doslynxmessage("Unable to delete " << cp_TempName);
  32.         doslynxmessage(::sys_errlist[::errno]);
  33.     }
  34. }